<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .box{
            width: 200px;
            height: 200px;
            background-color: pink;
            /* 谁需要过渡谁添加transition*/
            /* transition: width 1s, background-color 2s; */
            /* 如果需要过渡的属性多常用写法 all time; */
            transition: all 1s;
        }
        /* 需要一个事件触发（鼠标悬停到盒子上） */
        .box:hover {
            width: 600px;
            background-color: red;
        }
    </style>
</head>
<body>
    <div class="box"></div>
</body>
</html>